package cn.itcast.web.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/FuWuQiServlet")
public class FuWuQiServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        1.获取到用户名和密码
        String name = request.getParameter("name");
        String mima = request.getParameter("mima");

//        2.判断是否是否一样
        if ("jack".equalsIgnoreCase(name)&&"123".toString().equalsIgnoreCase("mima")){
//        3.一样和不一样返还不同的结果
            response.setContentType("登录成功");
        }else {
            response.setContentType("失败");

        }

    }
}
